grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
                      xml: ['text/xml', 'application/xml'],
                      text: 'text/plain',
                      js: 'text/javascript',
                      rss: 'application/rss+xml',
                      atom: 'application/atom+xml',
                      css: 'text/css',
                      csv: 'text/csv',
                      all: '*/*',
                      json: ['application/json','text/json'],
                      form: 'application/x-www-form-urlencoded',
                      multipartForm: 'multipart/form-data'
                    ]
// The default codec used to encode data with ${}
grails.views.default.codec="none" // none, html, base64
grails.views.gsp.encoding="UTF-8"
grails.converters.encoding="UTF-8"

// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true

// set per-environment serverURL stem for creating absolute links
grails {
   mail {
     host = "smtp.gmail.com"
     port = 465
     username = "drawYourDestinyAccount@gmail.com"
     password = "passwordcomics"
     props = ["mail.smtp.auth":"true", 					   
              "mail.smtp.socketFactory.port":"465",
              "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
              "mail.smtp.socketFactory.fallback":"false"]
   }
}


environments {
	development{
		grails.serverURL = "http://localhost:8080"
		comics{
			availChars=[]
			//	CONSTRAITS
			maxSizeComic=10485760		// 10M 
			maxSizeAvatar=10485760		// 10M
			defaultPathImageAvatarM	='maleGender.png'
			defaultPathImageAvatarF	='femaleGender.png'
			defaultPathImageAvatarN	='noneGender.png'
			defaultPathImageComic	='noneComic.png'
			
			// ENUMS
			allowedTypeFiles=['PNG','GIF', 'JPG', 'JPEG']
			gender=['N','M','F']	//none, male, female
			
			//	PATHS
			path=System.properties["user.dir"]+'/web-app/uploads'
			fileFolders=['/comic','/user']
		}
		
		log4j = {
		   appenders {
			   appender new org.apache.log4j.DailyRollingFileAppender(name:"stacktrace", fileName:"${System.properties['user.dir']}/logs/stacktrace.log",
					   datePattern: '\'_\'yyyy-MM-dd', layout:pattern(conversionPattern: '%d{ISO8601}\t%p\t%c:%L\t%m%n'))
			   
			   console name:'stdout', layout:pattern(conversionPattern: '%d{ISO8601}\t%p\t%c:%L\t%m%n')
		   }

		   error  	'org.codehaus.groovy.grails.web.servlet',  //  controllers
					'org.codehaus.groovy.grails.web.pages', //  GSP
					'org.codehaus.groovy.grails.web.sitemesh', //  layouts
					'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
					'org.codehaus.groovy.grails.web.mapping', // URL mapping
					'org.codehaus.groovy.grails.commons', // core / classloading
					'org.codehaus.groovy.grails.plugins', // plugins
					'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
					'org.springframework',
					'org.hibernate'

			warn  	'org.mortbay.log'
			
			debug 	'stacktrace':'grails.app'
						
			additivity = true 
		}
		
	}
    production {
        grails.serverURL = "http://ser-g.homelinux.org:8185"
		
		comics{
			availChars=[]
			//	CONSTRAITS
			maxSizeComic=10485760		// 10M 
			maxSizeAvatar=10485760		// 10M
			defaultPathImageAvatarM	='maleGender.png'
			defaultPathImageAvatarF	='femaleGender.png'
			defaultPathImageAvatarN	='noneGender.png'
			defaultPathImageComic	='noneComic.png'
			
			// ENUMS
			allowedTypeFiles=['PNG','GIF', 'JPG', 'JPEG']
			gender=['N','M','F']	//none, male, female
			
			//	PATHS
			path="${System.properties['user.dir']}/../webapps/${appName}-${appVersion}/uploads/"
			fileFolders=['/comic','/user']
			
			
			log4j = {
			   appenders {
				   appender new org.apache.log4j.DailyRollingFileAppender(name:"stacktrace", fileName:"${System.properties['user.dir']}/../logs/stacktrace.log",
						   datePattern: '\'_\'yyyy-MM-dd', layout:pattern(conversionPattern: '%d{ISO8601}\t%p\t%c:%L\t%m%n'))
				   
				   console name:'stdout', layout:pattern(conversionPattern: '%d{ISO8601}\t%p\t%c:%L\t%m%n')
			   }

			   error  	'org.codehaus.groovy.grails.web.servlet',  //  controllers
						'org.codehaus.groovy.grails.web.pages', //  GSP
						'org.codehaus.groovy.grails.web.sitemesh', //  layouts
						'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
						'org.codehaus.groovy.grails.web.mapping', // URL mapping
						'org.codehaus.groovy.grails.commons', // core / classloading
						'org.codehaus.groovy.grails.plugins', // plugins
						'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
						'org.springframework',
						'org.hibernate'

				warn  	'org.mortbay.log'
				
				debug 	'stacktrace':'grails.app'
							
				additivity = true 
			}
		}
    }
}